package com.java.yz.day13.ketang;

import java.io.*;

/*
    InputStreamReader 字符输入流
        public InputStreamReader(InputStream in)
        public InputStreamReader(InputStream in,String charsetName)
 */
public class InputStreamReaderDemo1 {
    public static void main(String[] args) {
       //public InputStreamReader(InputStream in)
       //第一种构造方法传入InputStream的一个具体实现子类
        InputStreamReader isr = null;
        try {
            //isr = new InputStreamReader(new FileInputStream("src/com/java/yz/day13/ketang/e.txt"));

            //第二种构造方法传入InputStream的一个具体实现子类并且加上一个编码表
            isr = new InputStreamReader(new FileInputStream("src/com/java/yz/day13/ketang/d.txt"),"GBK");
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        } finally {
            if (isr != null){
                try {
                    isr.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
